package com.pretty.adminapp.utils;

import java.util.Random;

/**
 * 随机数
 * @author zhengqiang.szq
 *
 */
public class RandomUtil {
	private static final Random random = new Random();
	/**
	 * 随机数
	 * @param num
	 * @return
	 */
	public static String getNumber(int num){
		StringBuffer buffer = new StringBuffer();
		Random random = new Random();
		for (int i = 0; i < num; i++) {
			buffer.append(random.nextInt(10));
		}
		return buffer.toString();
	}
	
	/**
	 * 取得一个随机数
	 * @return
	 */
	public static int getRandom(){
		return random.nextInt(Integer.MAX_VALUE);
	}
	
	public static void main(String[] args) {
		System.out.println(RandomUtil.getNumber(5));
	}
}
